package com.qk.management.mapper;

import com.qk.entity.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @文件名: DeptMapper
 * @作者: DX
 * @创建日期: 2025/9/29
 * @描述:
 */
@Mapper
public interface DeptMapper {

    @Insert("insert into dept(name,status,create_time,update_time) values(#{name},#{status},#{createTime},#{updateTime})")
    void innsert(Dept dept);


    Integer count(@Param("name") String name,@Param("status") Integer status);

    List<Dept> page(@Param("name") String name,
                    @Param("status") Integer status,
                    @Param("offset") Integer offset,
                    @Param("pageSize") Integer pageSize);

    @Select("select * from dept where id = #{id}")
    Dept getById(Integer id);


    void update(Dept dept);

    @Delete("delete from dept where id = #{id}")
    void delete(Integer id);

    List<Dept> listAll();
}
